<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>iterator</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <table border="1px" width="400px">
    	<s:iterator value="{'疯狂java讲义','Java编程思想','疯狂iOS讲义'
			}" id="name" status="st">
			<tr <s:if test="#st.odd">style="background-color:#bbbbbb"</s:if>>
				<td><s:property value="name"/></td>
			</tr>
		</s:iterator>
    </table>
    <table border="1px" width="400px">
    	<tr>
    		<th>书名</th>
    		<th>作者</th>
    	</tr>
    </table>
    <table border="1px" width="400px">
    	<!-- 指定Map对象迭代输出 -->
    	<s:iterator value="{'疯狂java讲义':'李刚','Java编程思想':'李刚','疯狂iOS讲义':'李刚'
			}" id="score" status="st">
			<tr <s:if test="#st.odd">style="background-color:#bbbbbb"</s:if>>
				<td><s:property value="key"/></td>
				<td><s:property value="value"/></td>
			</tr>
		</s:iterator>
    </table>
  </body>
</html>
